package xyz.xmh.pattern.structural.decoratorpattern;

/**
 * @author Administrator
 * 继承抽象装饰类，红色形状
 */
public class RedShapeDecorator extends ShapeDecorator {
    /**
     * 继承父类的构造函数
     *
     * @param decoratorShape 形状
     */
    public RedShapeDecorator(Shape decoratorShape) {
        super(decoratorShape);
    }

    @Override
    public void draw() {
        decoratorShape.draw();
        // 新增功能
        setRedBorder();
    }

    /**
     * 添加新功能
     * 红色边框
     */
    private void setRedBorder() {
        System.out.println("--->>>RedShapeDecorator.setRedBorder.....");
    }
}
